package com.baturu.vin.gm.dal.dao;

import com.baturu.vin.gm.dto.GMBtrPartsDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @Author: chenjiahao
 * @Time: 2019/6/26
 */
public interface GMBtrPartsDAO {
    @Select({"<script>",
            "SELECT basic_parts_name, btr_parts_name, suffix, distinguishing_marks",
            "FROM gm_btr_parts_mapping",
            "WHERE brand_name = #{brand}",
            "AND btr_parts_name in ",
            "<foreach collection='btrPartsNames' item='item' separator=',' open='(' close = ')'>",
            "#{item}",
            "</foreach>",
            "AND is_deleted = 0",
            "</script>"})
    Set<GMBtrPartsDTO> queryBtrPartsNameByBrand(@Param("brand") String brand, @Param("btrPartsNames") Set<String> btrPartsNames);
}
